IDLAsyncBridgeTaskJob

The IDLAsyncBridgeTaskJob class encapsulates the combined behaviors of its base classes IDLAsyncBridgeJob and IDLTaskJob. It allows the user to specify a single IDLTask that will be executed inside an IDL_IDLBridge when there are available resources. The IDLTask must have all of its input parameters specified before creating this job, as it will be cloned and dehydrated for passage to the bridge via IDL_IDLBridge::SetVar.

Superclasses

Examples

; Download a few 'images of the day' from eoimages.gsfc.nasa.gov

mainURL = 'https://eoimages.gsfc.nasa.gov/images/imagerecords/149000/'

 

; List of files to download

files = [ '149538/cropsfranceground_gedi_2019_lrg.jpg', $

          '149554/antarctic_meteorites_2022_lrg.jpg', $

          '149502/salardeuyuni_tmo_202250_lrg.jpg', $

          '149518/northatlantic_alan_04_lrg.jpg' ]

 

; create a folder in the temp folder for the local files

localFolder = FilePath(datasetName, /TMP)

if (~File_Test(localFolder)) then File_MkDir, localFolder

; construct IDLAsyncJoin object to use for waiting on all jobs to complete

oJoin = IDLAsyncJoin()

; construct IDLAsyncQueue to manage parallel execution of jobs

oQueue = IDLAsyncQueue(CONCURRENCY=2)

; create object array to hold all jobs

jobs = ObjArr(N_Elements(files))

; create task to be used by the jobs

task = IDLTask('Download_S3_URL')

 

; construct a unique job for each remote file to download

foreach file, files, i do begin

  ; update task parameters to current file suffix

  task.S3_URL = mainURL + file

  task.LOCAL_FILE = FilePath(File_Basename(file), ROOT=localFolder)

  ; construct IDLAsyncBridgeTaskJob that clones the task,

  ; passing in the join object

  jobs[i] = IDLAsyncBridgeTaskJob(task, JOIN=oJoin)

endforeach

 

; submit all the jobs to the queue for execution

oQueue.SubmitJob, jobs

; wait for all jobs to be done

oJoin.WaitForJoin

Syntax

Result = IDLAsyncBridgeTaskJob(Task [, INIT_COMMAND=String] [, JOIN=IDLAsyncJoin])

Arguments

Task

A scalar IDLTask object owned by this job, which will be executed inside an IDL_IDLBridge when Start is called.

Keywords

INIT_COMMAND (optional)

A scalar string of IDL code to be executed inside the bridge when it is initialized.

JOIN (optional)

An IDLAsyncJoin object that is passed to IDLAsyncJob base class Init() method for handling.

Methods

Properties

IDLAsyncBridgeTaskJob inherits all properties from IDLAsyncBridgeJob and IDLTaskJob.

IDLAsyncBridgeTaskJob::OnDone

The IDLAsyncBridgeTaskJob::OnDone method is an implementation override of IDLAsyncJob callback invoked on this job by the Done event handler. The basic sequence of operations follows:

Syntax

IDLAsyncBridgeTaskJob.OnDone

Arguments

None

Keywords

None

Version History

8.7

Introduced

See Also

IDLAsyncBridgeJob, IDLAsyncJob, IDLAsyncJoin, IDLTaskJob